<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
    <div id="root">
        <input v-model="str" type="text">
        <div>{{str.split("").reverse().join("")}}</div>
        <div>{{fn()}}</div>
        <div>{{fn()}}</div>
        <div>{{fn()}}</div>
        <div>{{fn()}}</div>
        <div>{{fn()}}</div>
        <div>{{str | fn2}}</div>
        <div>{{str | fn2}}</div>
        <div>{{str | fn2}}</div>
        <div>{{str | fn2}}</div>
        <div>{{str | fn2}}</div>
        <div>{{str | fn2}}</div>
        <div>{{fn3}}</div>
        <div>{{fn3}}</div>
        <div>{{fn3}}</div>
        <div>{{fn3}}</div>
        <div>{{fn3}}</div>
        <div>{{fn3}}</div>
        <div>{{fn3}}</div>
    </div>
</body>
<script>
    new Vue({
        el:"#root",
        data:{
            str:"超级魔法师"
        },
        methods:{
            fn(){
                console.log("fn")
                return this.str.split("").reverse().join("")
            }
        },
        filters:{
            fn2(v){
                console.log("fn2")
                return v.split("").reverse().join("");
            }
        },
        computed:{
            fn3(){
                console.log("fn3")
                return  this.str.split("").reverse().join("");
            }
        }
    })
</script>
</html>